package SecurityCheck;

public class SecurityScanner {
    private static final String[] DANGEROUS_ITEMS = {
            "刀具", "打火机", "汽油", "鞭炮", "枪支", "硫酸"
    };

    public void scanItem(String item) throws DangerousItemException {
        for (String dangerous : DANGEROUS_ITEMS) {
            if (dangerous.equals(item)) {
                throw new DangerousItemException("警告！检测到危险品：" + item);
            }
        }
        System.out.println("物品 " + item + " 安全，可通过安检。");
    }
}
